package com.uzai.console.web.sop;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.cms.base.CmsBaseInfoDto;
import com.uzai.console.dto.sop.wxqaddfriendconfig.WxqAddFriendConfigDto;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.sop.WxqAddFriendConfigService;
import com.uzai.console.vo.cms.base.CmsBaseInfoVo;
import com.uzai.console.vo.sop.wxqaddfriendconfig.WxqAddFriendConfigVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * CMS小程序|基础设置
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "加进群好友配置",tags = "SOP任务|加进群好友配置")
@ApiSort(7)
@RestController
public class WxqAddFriendConfigController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(WxqAddFriendConfigController.class);

    @Autowired
    private WxqAddFriendConfigService wxqAddFriendConfigService;


    @ApiOperation(value = "查询加进群好友配置信息", notes = "查询加进群好友配置信息", response = WxqAddFriendConfigVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/wxqAddFriendConfig/findWxqAddFriendConfig")
    public Object findWxqAddFriendConfig(){
        return wxqAddFriendConfigService.findWxqAddFriendConfig(getLoginInfo().getMerId());
    }

    @SystemLogType(model = SystemModelEnum.WxqAddFriendConfig, type = OperationTypeEnum.UPDATE)
    @ApiOperation(value = "保存加进群好友配置信息", notes = "保存加进群好友配置信息")
    @ApiOperationSupport(order = 2)
    @PostMapping("/wxqAddFriendConfig/updateWxqAddFriendConfig")
    public Object updateWxqAddFriendConfig(@RequestBody WxqAddFriendConfigDto wxqAddFriendConfigDto){
        wxqAddFriendConfigService.updateWxqAddFriendConfig(wxqAddFriendConfigDto);
        return true;
    }

}
